//
//  MQCollectionHeaderView.m
//  MQ
//
//  Created by lanou on 15/10/27.
//  Copyright © 2015年 徐永祥. All rights reserved.
//

#import "MQCollectionHeaderView.h"

@implementation MQCollectionHeaderView
-(instancetype)initWithFrame:(CGRect)frame
{

    self = [super initWithFrame:frame];
    if (self) {
        _scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, screen_width, 120)];
        _scrollView.contentSize = CGSizeMake(screen_width*2,0);
        _scrollView.pagingEnabled = YES;
        [self addSubview:_scrollView];
        
        
        for (int i = 0 ; i<2; i++) {
            UIImageView * pictureView = [[UIImageView alloc]initWithFrame:CGRectMake(i*screen_width, 0, screen_width, 120)];
                        [_scrollView addSubview:pictureView];
            UILabel * titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10+i*screen_width, 100, screen_width-20, 20)];
            titleLabel.textColor = [UIColor whiteColor];
            titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:16];
            [_scrollView addSubview:titleLabel];
        }
        
        _pageControl = [[UIPageControl alloc]initWithFrame:CGRectMake(screen_width/2-20, 80, 20, 20)];
        _pageControl.currentPageIndicatorTintColor = [UIColor grayColor];
        _pageControl.pageIndicatorTintColor = [UIColor whiteColor];
        _pageControl.numberOfPages=2;
        [self addSubview:_pageControl];
       
    }
    return self;
}
@end
